Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngdocs): remove duplicate header ids #4778

Closed
wants to merge 2 commits into from

Conversation

mkolodny
Copy link
Contributor

@mkolodny mkolodny commented Nov 4, 2013

Headers with ids are being given additional id attributes.
That's causing the test "ngdoc usage overview should supress description heading" to fail while building the documentation.
This prevents additional id attributes from being added to a header that already has an id.

@ghost ghost assigned IgorMinar Nov 4, 2013
@mkolodny
Copy link
Contributor Author

mkolodny commented Nov 5, 2013

Is there anything I can do to ease the merge process?
The error is happening while running npm install, and I haven't touched package.json.

@petebacondarwin
Copy link
Contributor

@mkolodny - what do you mean by the error is happening during npm install?

@petebacondarwin
Copy link
Contributor

Can you try with this fix: #4794? When this is in place, the ngdoc generation tests all pass.

@ghost ghost assigned petebacondarwin Nov 5, 2013
@mkolodny
Copy link
Contributor Author

mkolodny commented Nov 5, 2013

@petebacondarwin - I meant that the error during the Travis CI build happened while running npm install. All's well otherwise.

@mkolodny
Copy link
Contributor Author

mkolodny commented Nov 5, 2013

With fix #4794 in place, I still see two errors when running ./gen_docs.sh:

  • "ngdoc markdown should replace text between two [pre] tags"
  • "ngdoc TAG @description should support multiple pre blocks"

@mkolodny
Copy link
Contributor Author

mkolodny commented Nov 5, 2013

With the following pull request, the remaining two failing tests are now passing: #4796.

@petebacondarwin
Copy link
Contributor

What versions are you running? I don't get these errors and we don't see them in the CI server builds either: http://ci.angularjs.org/view/AngularJS/job/angular.js-angular-master/1788/console

@mkolodny
Copy link
Contributor Author

mkolodny commented Nov 6, 2013

I'm running all of the versions from package.json and bower.json. The errors from #4796 don't happen when running grunt package, only when running ./gen_docs.sh.

@petebacondarwin
Copy link
Contributor

I think the problem - looking at #4822 - is that marked has updated with a breaking change to 0.2.10. In environments where this dependency has been updated, the build is failing, yes?

@mkolodny
Copy link
Contributor Author

mkolodny commented Nov 8, 2013

Nice catch. Yes, when generating the docs with marked@0.2.10, the documentation build fails. But it passes with marked@0.2.9.

If it would be helpful to update marked to v0.2.10, the fixes in this pull request and #4796 together make the build pass with marked@0.2.10.

@petebacondarwin
Copy link
Contributor

Oh, I see now!

  • The new version of marked adds in ids to headings.
  • A number of our tests don't include these ids in the expected HTML
  • In one case there is an id already in the HTML and we are adding yet another (which this PR fixes)

Given that marked is now adding ids automatically, we should either be overriding them or using them as-is. Not sure how marked does it but our format creates ids based on the hierarchy of headings. If marked doesn't do this then we need to override theirs.

@mkolodny
Copy link
Contributor Author

mkolodny commented Nov 8, 2013

I think that's exactly right.

Marked simply uses a header's text as its id, although it now allows header prefixes. See https://github.com/chjj/marked/blob/master/lib/marked.js#L850.

I'll update this PR to override marked ids with our format.

@petebacondarwin
Copy link
Contributor

@mkolodny - reverting to 0.2.9 has made this change unnecessary right now. I am going to put it into the post 1.2 branch to look at when we choose to upgrade marked.

@IgorMinar
Copy link
Contributor

I'm sorry, but I wasn't able to verify your CLA signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let me know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

@petebacondarwin
Copy link
Contributor

We are going to rewrite the doc gen tool so this PR is no longer relevant.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants